Skip to content

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Oct 20, 2025

Based on #15866

This adds a parsing context that can allocate from an arena. Ultimately this will also store a source map for better error reporting, but a few other changes are happening before that.

The arena itself is unlikely to be needed from a perf standpoint (reading all the files should be the slow part), but having more things be copyable is nice. For reference the perf impact of this change is within the noise.

changelog: none

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2025

r? @samueltardieu

rustbot has assigned @samueltardieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@samueltardieu
Copy link
Member

@rustbot label S-blocked
by #15866

pub fn deprecate(clippy_version: Version, name: &str, reason: &str) {
let mut lints = find_lint_decls();
let (mut deprecated_lints, renamed_lints) = read_deprecated_lints();
pub fn deprecate<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, name: &'env str, reason: &'env str) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of those lifetimes are necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are overly complicated. Just 'cx would be enough.

impl ParseCxImpl {
/// Finds all lint declarations (`declare_clippy_lint!`)
#[must_use]
pub fn find_lint_decls(&mut self) -> Vec<Lint> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It is strange that in this commit &mut self is used as a parameter and never used. This would not pass dogfood should the PR be partially merged up to this commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is about the first commit? Github doesn't present any information about what commit you add a comment to, unfortunately.

The commit sets up the interface changes needed to use the context. Not taking self would change that. unused_self shouldn't even lint on ZSTs since they don't actually contain anything, but their mere existence can still mean something.

}

#[must_use]
pub fn read_deprecated_lints(&mut self) -> (Vec<DeprecatedLint>, Vec<RenamedLint>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as above about &mut self

@samueltardieu samueltardieu added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work label Oct 21, 2025
@samueltardieu
Copy link
Member

@rustbot label -S-blocked

@rustbot rustbot removed the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work label Oct 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 22, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@samueltardieu samueltardieu added this pull request to the merge queue Oct 23, 2025
Merged via the queue into rust-lang:master with commit 82d729c Oct 23, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants